Re: [OpenWrt-Devel] AsiaRF MT7620a mounting sdhci drive readonly
Hi Luis, i have a awm0003 on my desk and will have a look during the week. John On 23/08/2014 23:26, Luis Soltero wrote: Hello All, Been trying to get an AsiaRF based MT7620a board running using CC r42230 and having issue getting the MMC SD card reader to mount rw. I have been in communication with the manufacturer to discover the GPIO (if any) used for the WP line for the SDHCI card reader on the board. They have not gotten back to me. In the mean time I have attempted to use some of the mmc driver properties such as wp-inverted to no avail. In desperation I implemented a patch based on http://permalink.gmane.org/gmane.linux.kernel.mmc/25615 which tells the driver to ignore the write protect line and assume r/w always... yet the card still mounts read only. note that when mounting the same SD card using a USB based reader the file system mounts rw as expected. here is the mount table showing the ro mount root@OpenWRT:~# mount rootfs on / type rootfs (rw) snip... /dev/mmcblk0p2 on /wxa type ext4 (ro,relatime,data=ordered) here is the DTS definition for the board sdhci@1013 { status = okay; broken-wp; }; following is the patch (some of you might find it useful). Any thoughts would greatly be appreciated. $ cat target/linux/ramips/patches-3.10/0402-mmc-add-broken-wp.patch --- a/Documentation/devicetree/bindings/mmc/mmc.txt2014-08-23 12:39:54.816004290 -0700 +++ b/Documentation/devicetree/bindings/mmc/mmc.txt2014-08-23 12:40:56.574123135 -0700 @@ -21,6 +21,8 @@ below for the case, when a GPIO is used for the CD line - wp-inverted: when present, polarity on the WP line is inverted. See the note below for the case, when a GPIO is used for the WP line +- broken-wp: when present, no indication of write protection is available, + and write protection is assumed always off. - max-frequency: maximum operating clock frequency - no-1-8-v: when present, denotes that 1.8v card voltage is not supported on this system, even if the controller claims it is. --- a/drivers/mmc/host/sdhci-pltfm.c 2014-08-23 12:44:02.648454500 -0700 +++ b/drivers/mmc/host/sdhci-pltfm.c2014-08-23 12:45:52.009124011 -0700 @@ -80,7 +80,9 @@ bus_width == 1)) host-quirks |= SDHCI_QUIRK_FORCE_1_BIT_DATA; -if (sdhci_of_wp_inverted(np)) +if (of_get_property(np, sdhci,broken-wp, NULL) || of_get_property(np, broken-wp, NULL)) +host-quirks2 |= SDHCI_QUIRK2_BROKEN_WRITE_PROTECT; +else if (sdhci_of_wp_inverted(np)) host-quirks |= SDHCI_QUIRK_INVERTED_WRITE_PROTECT; if (of_get_property(np, broken-cd, NULL)) --- a/drivers/mmc/host/sdhci.c2014-08-23 12:46:10.028575138 -0700 +++ b/drivers/mmc/host/sdhci.c2014-08-23 12:48:23.588506665 -0700 @@ -1621,6 +1621,8 @@ if (host-flags SDHCI_DEVICE_DEAD) is_readonly = 0; +else if (host-quirks2 SDHCI_QUIRK2_BROKEN_WRITE_PROTECT) + is_readonly = 0; else if (host-ops-get_ro) is_readonly = host-ops-get_ro(host); else --- a/include/linux/mmc/sdhci.h 2014-08-23 12:56:38.005445877 -0700 +++ b/include/linux/mmc/sdhci.h 2014-08-23 12:58:58.113178602 -0700 @@ -95,6 +95,8 @@ /* The system physically doesn't support 1.8v, even if the host does */ #define SDHCI_QUIRK2_NO_1_8_V(12) #define SDHCI_QUIRK2_PRESET_VALUE_BROKEN(13) +/* There is no indication for write protection at all, assume RW */ +#define SDHCI_QUIRK2_BROKEN_WRITE_PROTECT(14) int irq;/* Device IRQ */ void __iomem *ioaddr;/* Mapped address */ ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] [PATCH] [boot] /init: allow easier customisation of ramfs boot.
* Stephen Parry sgpa...@mainscreen.com [24.08.2014 08:28]: +if [ -e /bin/ramfsinit ]; then + exec /bin/ramfsinit +fi better use: elif [ -e /sbin/ramfsinit ]; then +if [ -e /sbin/ramfsinit ]; then + exec /sbin/ramfsinit +fi bye, bastian ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
Re: [OpenWrt-Devel] AsiaRF MT7620a mounting sdhci drive readonly
hello john, thanks for looking into this... just so that you know I forced is_readonly = 0 in sdhci.c as in ... static int sdhci_check_ro(struct sdhci_host *host) { unsigned long flags; int is_readonly; spin_lock_irqsave(host-lock, flags); if (host-flags SDHCI_DEVICE_DEAD) is_readonly = 0; else if (host-quirks2 SDHCI_QUIRK2_BROKEN_WRITE_PROTECT) is_readonly = 0; else if (host-ops-get_ro) is_readonly = host-ops-get_ro(host); else is_readonly = !(sdhci_readl(host, SDHCI_PRESENT_STATE) SDHCI_WRITE_PROTECT); is_readonly = 0; spin_unlock_irqrestore(host-lock, flags); return 0; and yet... root@Optimizer:~# e2fsck /dev/mmcblk0p2 e2fsck 1.42.4 (12-June-2012) e2fsck: Read-only file system while trying to open /dev/mmcblk0p2 Disk write-protected; use the -n option to do a read-only check of the device. so unsure at this time why the driver thinks that this is a read only file system. look forward to your findings. --luis On 8/24/14, 2:07 AM, John Crispin wrote: Hi Luis, i have a awm0003 on my desk and will have a look during the week. John On 23/08/2014 23:26, Luis Soltero wrote: Hello All, Been trying to get an AsiaRF based MT7620a board running using CC r42230 and having issue getting the MMC SD card reader to mount rw. I have been in communication with the manufacturer to discover the GPIO (if any) used for the WP line for the SDHCI card reader on the board. They have not gotten back to me. In the mean time I have attempted to use some of the mmc driver properties such as wp-inverted to no avail. In desperation I implemented a patch based on http://permalink.gmane.org/gmane.linux.kernel.mmc/25615 which tells the driver to ignore the write protect line and assume r/w always... yet the card still mounts read only. note that when mounting the same SD card using a USB based reader the file system mounts rw as expected. here is the mount table showing the ro mount root@OpenWRT:~# mount rootfs on / type rootfs (rw) snip... /dev/mmcblk0p2 on /wxa type ext4 (ro,relatime,data=ordered) here is the DTS definition for the board sdhci@1013 { status = okay; broken-wp; }; following is the patch (some of you might find it useful). Any thoughts would greatly be appreciated. $ cat target/linux/ramips/patches-3.10/0402-mmc-add-broken-wp.patch --- a/Documentation/devicetree/bindings/mmc/mmc.txt2014-08-23 12:39:54.816004290 -0700 +++ b/Documentation/devicetree/bindings/mmc/mmc.txt2014-08-23 12:40:56.574123135 -0700 @@ -21,6 +21,8 @@ below for the case, when a GPIO is used for the CD line - wp-inverted: when present, polarity on the WP line is inverted. See the note below for the case, when a GPIO is used for the WP line +- broken-wp: when present, no indication of write protection is available, + and write protection is assumed always off. - max-frequency: maximum operating clock frequency - no-1-8-v: when present, denotes that 1.8v card voltage is not supported on this system, even if the controller claims it is. --- a/drivers/mmc/host/sdhci-pltfm.c 2014-08-23 12:44:02.648454500 -0700 +++ b/drivers/mmc/host/sdhci-pltfm.c2014-08-23 12:45:52.009124011 -0700 @@ -80,7 +80,9 @@ bus_width == 1)) host-quirks |= SDHCI_QUIRK_FORCE_1_BIT_DATA; -if (sdhci_of_wp_inverted(np)) +if (of_get_property(np, sdhci,broken-wp, NULL) || of_get_property(np, broken-wp, NULL)) +host-quirks2 |= SDHCI_QUIRK2_BROKEN_WRITE_PROTECT; +else if (sdhci_of_wp_inverted(np)) host-quirks |= SDHCI_QUIRK_INVERTED_WRITE_PROTECT; if (of_get_property(np, broken-cd, NULL)) --- a/drivers/mmc/host/sdhci.c2014-08-23 12:46:10.028575138 -0700 +++ b/drivers/mmc/host/sdhci.c2014-08-23 12:48:23.588506665 -0700 @@ -1621,6 +1621,8 @@ if (host-flags SDHCI_DEVICE_DEAD) is_readonly = 0; +else if (host-quirks2 SDHCI_QUIRK2_BROKEN_WRITE_PROTECT) + is_readonly = 0; else if (host-ops-get_ro) is_readonly = host-ops-get_ro(host); else --- a/include/linux/mmc/sdhci.h 2014-08-23 12:56:38.005445877 -0700 +++ b/include/linux/mmc/sdhci.h 2014-08-23 12:58:58.113178602 -0700 @@ -95,6 +95,8 @@ /* The system physically doesn't support 1.8v, even if the host does */ #define SDHCI_QUIRK2_NO_1_8_V(12) #define SDHCI_QUIRK2_PRESET_VALUE_BROKEN(13) +/* There is no indication for write protection at all, assume RW */ +#define SDHCI_QUIRK2_BROKEN_WRITE_PROTECT(14) int irq;/* Device IRQ */ void __iomem *ioaddr;/* Mapped address */ -- Luis Soltero, Ph.D., MCS Director of Software Development, CTO Global Marine Networks, LLC StarPilot, LLC Tel: +1.865.379.8723 Fax: +1.865.681.5017 E-Mail: lsolt...@globalmarinenet.net Web: http://www.globalmarinenet.net Web: http://www.redportglobal.com Web: http://www.starpilotllc.com
[OpenWrt-Devel] [PATCH] mac80211: fix WARN_ON_ONCE() caused by inbalanced set/clear of beacon enable bit.
A WARN_ON_ONCE() dump was triggered on a MT7620A based device with following config. Fixes ticket #17032. config wifi-iface option device radio0 option network lan option mode ap option ssid OpenWrt__T option encryption none config wifi-iface option device radio0 option network lan option mode ap option ssid OpenWrt__TT option encryption none The dumped warning message. [ 23.89] [ cut here ] [ 23.90] WARNING: at /home/yousong/trunk-openwrt/build_dir/target-mipsel_24kec+dsp_uClibc-0.9.33.2/linux-ramips_mt7620a/compat-wireless-2014-05-22/drivers/net/wireless/rt2x00/rt2800lib.c:1092 rt2800_conf_tx+0x3c8/0x494 [rt2800lib]() [ 23.94] Modules linked in: rt2800soc rt2800pci rt2800mmio rt2800lib pppoe ppp_async iptable_nat rt2x00soc rt2x00pci rt2x00mmio rt2x00lib pppox ppp_generic nf_nat_ipv4 nf_conntrack_ipv4 mac80211 ipt_MASQUERADE cfg80211 xt_time xt_tcpudp xt_tcpmss xt_string xt_statistic xt_state xt_recent xt_nat xt_multiport xt_mark xt_mac xt_limit xt_length xt_hl xt_helper xt_ecn xt_dscp xt_conntrack xt_connmark xt_connlimit xt_connbytes xt_comment xt_TCPMSS xt_REDIRECT xt_LOG xt_HL xt_DSCP xt_CT xt_CLASSIFY ts_kmp ts_fsm ts_bm slhc nf_nat_irc nf_nat_ftp nf_nat nf_defrag_ipv4 nf_conntrack_irc nf_conntrack_ftp iptable_raw iptable_mangle iptable_filter ipt_REJECT ipt_ECN ip_tables crc_itu_t crc_ccitt compat act_connmark act_skbedit act_mirred em_u32 cls_u32 cls_tcindex cls_flow cls_route cls_fw sch_hfsc sch_ingress ledtrig_usbdev ip6t_REJECT ip6table_raw ip6table_mangle ip6table_filter ip6_tables x_tables nf_conntrack_ipv6 nf_conntrack nf_defrag_ipv6 ifb ipv6 eeprom_93cx6 arc4 crypto_blkcipher leds_gpio gpio_button_hotplug usbcore nls_base usb_common [ 24.13] CPU: 0 PID: 1502 Comm: hostapd Not tainted 3.10.44 #17 [ 24.14] Stack : 80322eea 0036 8390f818 83154140 80282f60 802d31fb 05de 80322694 8390f818 83154140 0008 001c 0001 8001f00c 0003 8001ca78 83173bd8 83154140 802847ec 82897794 82897720 ... [ 24.21] Call Trace: [ 24.22] [800121b4] show_stack+0x48/0x70 [ 24.22] [8001cb74] warn_slowpath_common+0x78/0xa8 [ 24.24] [8001cc2c] warn_slowpath_null+0x18/0x24 [ 24.25] [83164078] rt2800_conf_tx+0x3c8/0x494 [rt2800lib] [ 24.26] [ 24.26] ---[ end trace ff7bf97509953be2 ]--- Signed-off-by: Yousong Zhou yszhou4t...@gmail.com --- .../921-rt2x00-fix-beacon-bit-balance.patch| 50 1 file changed, 50 insertions(+) create mode 100644 package/kernel/mac80211/patches/921-rt2x00-fix-beacon-bit-balance.patch diff --git a/package/kernel/mac80211/patches/921-rt2x00-fix-beacon-bit-balance.patch b/package/kernel/mac80211/patches/921-rt2x00-fix-beacon-bit-balance.patch new file mode 100644 index 000..f43f2cc --- /dev/null +++ b/package/kernel/mac80211/patches/921-rt2x00-fix-beacon-bit-balance.patch @@ -0,0 +1,50 @@ +Index: compat-wireless-2014-05-22/drivers/net/wireless/rt2x00/rt2x00mac.c +=== +--- compat-wireless-2014-05-22.orig/drivers/net/wireless/rt2x00/rt2x00mac.c 2014-08-17 10:39:03.433122703 +0800 compat-wireless-2014-05-22/drivers/net/wireless/rt2x00/rt2x00mac.c 2014-08-17 10:52:18.050450172 +0800 +@@ -647,12 +647,7 @@ + } else if (bss_conf-enable_beacon !intf-enable_beacon) { + rt2x00dev-intf_beaconing++; + intf-enable_beacon = true; +- /* +- * Upload beacon to the H/W. This is only required on +- * USB devices. PCI devices fetch beacons periodically. +- */ +- if (rt2x00_is_usb(rt2x00dev)) +- rt2x00queue_update_beacon(rt2x00dev, vif); ++ rt2x00queue_update_beacon(rt2x00dev, vif); + + if (rt2x00dev-intf_beaconing == 1) { + /* +Index: compat-wireless-2014-05-22/drivers/net/wireless/rt2x00/rt2x00dev.c +=== +---
Re: [OpenWrt-Devel] [PATCH] brcm47xx: image: build alternative TRX using less optimized LZMA
On 23 August 2014 22:29, Stephen Parry sgpa...@mainscreen.com wrote: I for one second this patch. I have just bricked my router trying to get the current trx image to work on my WNR3500L. I am not sure why it worked previously but it does not now, but it was doing just as described, hanging at Starting program at 0x80001000. I thought it was because the MTD command had failed, so I tried from CFE and inadvertently overwrote my CFE - doh! First of all, I really don't think this patch itself may cause any problem with MTD/partitions/bricking. I don't understand much of your report. It was working previously? But then you say it was hanging? Then you mention some MTD command failing...? What did you do in CFE? Which firmware did you try to install at all? What was the log of firmware booting destroying your CFE? This report says nothing :( ___ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel